﻿@model NewLife.YuqueWeb.Models.BookIndexModel
@using NewLife.Data
@using NewLife.YuqueWeb.Entity
@using NewLife.YuqueWeb.Models
@using PageModel=NewLife.YuqueWeb.Models.PageModel;
@{
    Layout = "~/Views/Shared/_Layout_yq.cshtml";

    var cat = Model.Book;
    var infos = Model.Documents;
    var page = new PageModel { Page = Model.Page, Url = $"/{cat.Code}-pageIndex" };
}
<div class="lark">
    <div class="BookOverview-module_container">
        <div class="BookOverview-module_bookHead">
            <div class="BookOverview-module_bookTitle">
                <span class="BookOverview-module_bookName">@cat.Name</span>
            </div>
        </div>
        @{
            <ul class="BookOverview-module_tocContainer">
                @foreach (var doc in infos)
                {
                    <li>
                        <a href="/@cat.Code/@doc.Code">
                            <div class="column-module_columnItem">
                                <div class="column-module_content">
                                    @if (!doc.Cover.IsNullOrEmpty())
                                    {
                                        <div class="column-module_left column-module_left_pic">
                                            <div class="column-module_title">@doc.Title</div>
                                            <div class="column-module_desc">@doc.Summary</div>
                                            <div class="column-module_date">
                                                <span>@doc.PublishTime.ToFullString()</span>
                                            </div>
                                        </div>
                                        <div class="column-module_right" style="background-image: url(&quot;@doc.Cover&quot;);">
                                        </div>
                                    }
                                    else
                                    {
                                        <div class="column-module_left">
                                            <div class="column-module_title">@doc.Title</div>
                                            <div class="column-module_desc">@doc.Summary</div>
                                            <div class="column-module_date">
                                                <span>@doc.PublishTime.ToFullString()</span>
                                            </div>
                                        </div>
                                    }
                                </div>
                            </div>
                        </a>
                    </li>
                }
            </ul>
            @await Html.PartialAsync("_Pager", page)
        }
    </div>
</div>